<? 
$attributes = array('class' => 'email', 'id' => 'checknew');
echo form_open('category/dels', $attributes);?>    
<input type="hidden" name="page" value="<?=$start?>">
<table class="admindata">
    <thead>
        <tr>
            <th colspan="5">
                <input type="submit" onclick="return verify_del();" name="btn_submit" class="submit" value="Xóa">
                Hiện có <?=$num?> chuyên mục <?=$pagination?>
            </th>
        </tr>
        <tr>
            <th width="20" class="checkbox"><input type="checkbox" name="sa" id="sa" onclick="check_chose('sa', 'ar_id[]', 'checknew')" /></th>
            <th width="62">Hình ảnh</th>			
            <th><?=lang('category');?></th>
            <th width="40" style="text-align:center;">Sort</th>
            <th width="90" class="publish" style="width: 90px;">Active</th>
        </tr>
    </thead>
    <?
    $k=1;
    foreach($list as $rs):
		if($rs->catsub==0)
		{
			$lb_image = $rs->lb_image? '<img src="'.base_url_site().'uploads/category/'.$rs->lb_image.'" width="60" />' : '' ;
	?>
    <tr class="row<?=$k?>">
        <td><input type="checkbox" name="ar_id[]" value="<?=$rs->catid?>"></td>
        <td><?=$lb_image?></td>
        <td><?=$rs->catname_vn?><br /><?=$rs->catname_en?></td>
        <td style="text-align:center;"><?=$rs->nb_order?></td>
        <td align="center">
            <?=icon_edit('category/edit/'.$rs->catid)?>
            <span id="publish<?=$rs->catid?>"><?=icon_active("'category'","'catid'",$rs->catid,$rs->bl_active)?></span>
            <?=icon_del('category/del/'.$rs->catid.'/'.(int)$this->uri->segment(4))?>
        </td>
    </tr>
    <?php
		}
		$k=1-$k;
		$listsub = $this->category->getCategory($rs->catid);
		foreach($listsub as $row):
			$lb_image = $rs->lb_image? '<img src="'.base_url_site().'uploads/category/'.$rs->lb_image.'" width="60" />' : '' ;
	?>
        <tr class="row<?=$k?>">
            <td><input type="checkbox" name="ar_id[]" value="<?=$row->catid?>"></td>
            <td><?=$lb_image?></td>
            <td>|__<?=$row->catname_vn?><br /><?=$rs->catname_en?></td>
            <td><?=$row->nb_order?></td>
            <td align="center">
                <?=icon_edit('category/edit/'.$row->catid)?>
                <span id="publish<?=$row->catid?>"><?=icon_active("'category'","'catid'",$row->catid,$row->bl_active)?></span>
                <?=icon_del('category/del/'.$row->catid.'/'.(int)$this->uri->segment(4))?>
            </td>
        </tr>
    <?
			$k=1-$k;
		endforeach;
    endforeach;
	?>
    <tfoot>
        <td colspan="5">
            <input type="submit" class="submit" onclick="return verify_del();" name="btn_submit" value="Xóa">
            Hiện có <?=$num?> chuyên mục <?=$pagination?>
        </td>
    </tfoot>
</table>  
<?=form_close()?>